package com.tanhua.recommend.handler;

import com.tanhua.domain.mongo.PublishScore;
import org.springframework.stereotype.Component;

/**
 * 发布动态的处理器
 */
@Component
public class PublishMovementHandler implements MovementHandler{
    // 自己操作类型
    private final Integer TYPE = 1;


    @Override
    public boolean shouldHandle(Integer type) {
        return TYPE.equals(type);
    }

    @Override
    public void handle(PublishScore publishScore, Integer type) {
//        // 发布动态
//        int score = 0;
//        Publish publish = publishApi.findById(publishId);
//        if (publish.getTextContent().length() < 50) {
//            score = 1;
//        } else if (publish.getTextContent().length() < 100) {
//            score = 2;
//        } else {
//            score = 3;
//        }
//        if (publish.getMedias() != null && publish.getMedias().size() > 0) {
//            score += publish.getMedias().size();
//        }
//        publishScore.setScore((double) score);
    }
}
